home *** CD-ROM | disk | FTP | other *** search
/ Developer Helper 1: Phil & Dave's Excellent CD / Excellent CD HFS.raw / HyperCard / HyperCard 1.2.2 International / HyperCard Swedish (S-1.2.2) / Fler buntar / Diagram / background_2620.txt < prev    next >
Text File  |  1989-01-05  |  7KB  |  324 lines

  1. -- background: 2620 from stack: in
  2. -- bmap block id: 2431
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on openBackground
  8.   push recent card
  9. end openBackground
  10.  
  11. function frameheight
  12. return 265
  13. end frameheight
  14.  
  15. function framewidth
  16. return 395
  17. end framewidth
  18.  
  19. function framebottom
  20. return 296
  21. end framebottom
  22.  
  23. function frameleft
  24. return 25
  25. end frameleft
  26.  
  27.  
  28.  
  29.  
  30. -- part 1 (button)
  31. -- low flags: 00
  32. -- high flags: 0000
  33. -- rect: left=0 top=314 right=342 bottom=37
  34. -- title width / last selected line: 0
  35. -- icon id / first selected line: 1014 / 1014
  36. -- text alignment: 1
  37. -- font id: 0
  38. -- text size: 12
  39. -- style flags: 0
  40. -- line height: 16
  41. -- part name: Prev
  42. ----- HyperTalk script -----
  43. on mouseUp
  44.   visual effect wipe right
  45.   go to previous card
  46. end mouseUp
  47.  
  48.  
  49. -- part 2 (button)
  50. -- low flags: 00
  51. -- high flags: 0000
  52. -- rect: left=37 top=317 right=342 bottom=69
  53. -- title width / last selected line: 0
  54. -- icon id / first selected line: 28022 / 28022
  55. -- text alignment: 1
  56. -- font id: 0
  57. -- text size: 12
  58. -- style flags: 0
  59. -- line height: 16
  60. -- part name: Home
  61. ----- HyperTalk script -----
  62. on mouseUp
  63.   visual effect iris close
  64.   go home
  65. end mouseUp
  66.  
  67.  
  68.  
  69.  
  70. -- part 3 (button)
  71. -- low flags: 00
  72. -- high flags: 0000
  73. -- rect: left=439 top=314 right=342 bottom=476
  74. -- title width / last selected line: 0
  75. -- icon id / first selected line: 1012 / 1012
  76. -- text alignment: 1
  77. -- font id: 0
  78. -- text size: 12
  79. -- style flags: 0
  80. -- line height: 16
  81. -- part name: Return
  82. ----- HyperTalk script -----
  83. on mouseUp
  84.   visual effect iris close
  85.   pop card
  86. end mouseUp
  87.  
  88.  
  89.  
  90. -- part 4 (button)
  91. -- low flags: 00
  92. -- high flags: 0000
  93. -- rect: left=476 top=314 right=342 bottom=512
  94. -- title width / last selected line: 0
  95. -- icon id / first selected line: 1013 / 1013
  96. -- text alignment: 1
  97. -- font id: 0
  98. -- text size: 12
  99. -- style flags: 0
  100. -- line height: 16
  101. -- part name: Next
  102. ----- HyperTalk script -----
  103. on mouseUp
  104.   visual effect wipe left
  105.   go to next card
  106. end mouseUp
  107.  
  108.  
  109. -- part 5 (field)
  110. -- low flags: 00
  111. -- high flags: 4007
  112. -- rect: left=440 top=26 right=299 bottom=501
  113. -- title width / last selected line: 0
  114. -- icon id / first selected line: 0 / 0
  115. -- text alignment: 65535
  116. -- font id: 3
  117. -- text size: 12
  118. -- style flags: 0
  119. -- line height: 16
  120. -- part name: Data
  121.  
  122.  
  123. -- part 6 (button)
  124. -- low flags: 00
  125. -- high flags: A003
  126. -- rect: left=76 top=314 right=336 bottom=132
  127. -- title width / last selected line: 0
  128. -- icon id / first selected line: 0 / 0
  129. -- text alignment: 1
  130. -- font id: 0
  131. -- text size: 12
  132. -- style flags: 0
  133. -- line height: 16
  134. -- part name: Stapel
  135. ----- HyperTalk script -----
  136. on mouseUp
  137.   put the userLevel into saveLevel
  138.   if the userLevel < 3 then set userLevel to 3
  139.   if the userLevel < 3 then exit mouseUp
  140.   clearScreen
  141.   put empty into background field "total"
  142.   reset paint
  143.   choose rect tool
  144.   set lineSize to 1
  145.   set pattern to 14
  146.   set filled to true
  147.   put frameleft() into horiz
  148.   put maxLine(field "Data") into maxValue
  149.   put the number of lines in field "Data" into dataCount
  150.   put round(framewidth()/dataCount) into horizStep
  151.   put round(horizStep * 3/4) into width
  152.   repeat with i = 1 to dataCount
  153.     get line i of field "data"
  154.     if it is not empty then
  155.       put round(frameheight() * it / maxValue) into height
  156.       drag from horiz,framebottom()-height to horiz+width,framebottom()
  157.     end if
  158.     add horizStep to horiz
  159.   end repeat
  160.   reset paint
  161.   choose browse tool
  162.   set userLevel to saveLevel
  163. end mouseUp
  164.  
  165.  
  166.  
  167.  
  168. -- part 7 (button)
  169. -- low flags: 00
  170. -- high flags: A003
  171. -- rect: left=137 top=314 right=336 bottom=193
  172. -- title width / last selected line: 0
  173. -- icon id / first selected line: 0 / 0
  174. -- text alignment: 1
  175. -- font id: 0
  176. -- text size: 12
  177. -- style flags: 0
  178. -- line height: 16
  179. -- part name: Mynt
  180. ----- HyperTalk script -----
  181. on mouseUp
  182.   put the userLevel into saveLevel
  183.   if the userLevel < 3 then set userLevel to 3
  184.   if the userLevel < 3 then exit mouseUp
  185.   clearScreen
  186.   put empty into background field "total"
  187.   reset paint
  188.   choose oval tool
  189.   set lineSize to 2
  190.   set filled to true
  191.  
  192.   put frameLeft() into horiz
  193.   put maxLine(field "Data") into maxValue
  194.   set cursor to 4 -- watchCursor
  195.  
  196.   put the number of lines in field "Data" into coins
  197.   if coins > 10 then
  198.     answer "Endast de 10 f√∂rsta talen kan ritas." with "OK"
  199.     put 10 into coins
  200.   end if
  201.  
  202.   repeat with i = 1 to coins
  203.     get line i of field "data"
  204.     if it is not empty then
  205.       put round(frameHeight()/8.2 * it/maxValue) into coinCount
  206.       set pattern to 13
  207.       drawCoins horiz,frameBottom()-2,coinCount
  208.     end if
  209.     add 40 to horiz
  210.   end repeat
  211.   reset paint
  212.   choose browse tool
  213.   set userLevel to saveLevel
  214. end mouseUp
  215.  
  216. on drawCoins left,bottom,howMany
  217.   put bottom into y
  218.   repeat with i = 1 to howMany
  219.     subtract 8 from y
  220.     drag from left,y to left+30,y+10
  221.   end repeat
  222. end drawCoins
  223.  
  224.  
  225.  
  226. -- part 10 (field)
  227. -- low flags: 00
  228. -- high flags: 0004
  229. -- rect: left=257 top=314 right=336 bottom=442
  230. -- title width / last selected line: 0
  231. -- icon id / first selected line: 0 / 0
  232. -- text alignment: 1
  233. -- font id: 20
  234. -- text size: 14
  235. -- style flags: 256
  236. -- line height: 18
  237. -- part name: 
  238.  
  239.  
  240. -- part 8 (button)
  241. -- low flags: 00
  242. -- high flags: A003
  243. -- rect: left=197 top=314 right=336 bottom=253
  244. -- title width / last selected line: 0
  245. -- icon id / first selected line: 0 / 0
  246. -- text alignment: 1
  247. -- font id: 0
  248. -- text size: 12
  249. -- style flags: 0
  250. -- line height: 16
  251. -- part name: Cirkel
  252. ----- HyperTalk script -----
  253. on mouseUp
  254.   put the userLevel into saveLevel
  255.   if the userLevel < 3 then set userLevel to 3
  256.   if the userLevel < 3 then exit mouseUp
  257.   put frameBottom()-frameHeight()+10 into pieTop
  258.   put frameLeft()+5 into pieLeft
  259.   put frameHeight()-20 into pieDiameter
  260.  
  261.   clearScreen
  262.   reset paint
  263.   choose oval tool
  264.   set lineSize to 2
  265.   set dragSpeed to 0
  266.   drag from pieLeft,pieTop to pieLeft+pieDiameter, pieTop+pieDiameter
  267.   set centered to false
  268.  
  269.   put the number of lines in field "Data" into dataCount
  270.   put zero into total
  271.   repeat with i = 1 to dataCount
  272.     add line i of field "Data" to total
  273.   end repeat
  274.   put "Total √§r" && total into background field "Total"
  275.  
  276.   put pieDiameter div 2 into pieRadius
  277.   put pieLeft+pieRadius into pieCenterX
  278.   put pieTop+pieRadius into pieCenterY
  279.  
  280.   choose line tool
  281.   put zero into angle
  282.   put zero into change
  283.   repeat with i = 1 to dataCount+1
  284.     put pieCenterX + round(pieRadius * sin(angle)) into x
  285.     put pieCenterY - round(pieRadius * cos(angle)) into y
  286.     choose line tool
  287.     drag from pieCenterX,pieCenterY to x,y
  288.     if change > .02 then
  289.       set pattern to getPattern(i)
  290.       choose bucket tool
  291.       click at halfX, halfY
  292.     end if
  293.  
  294.     get line i of field "data"
  295.     put pi * it / total into change
  296.     add change to angle
  297.     put pieCenterX + round((pieRadius-3) * sin(angle)) into halfX
  298.     put pieCenterY - round((pieRadius-3) * cos(angle)) into halfY
  299.     add change to angle
  300.  
  301.   end repeat
  302.   reset paint
  303.   choose browse tool
  304.   set userLevel to saveLevel
  305. end mouseUp
  306.  
  307. function getPattern selector
  308. return item (selector mod 12)+1 of "2,13,11,3,14,6,21,17,31,18,4,32"
  309. end getPattern
  310.  
  311.  
  312. -- part 9 (field)
  313. -- low flags: 00
  314. -- high flags: 0000
  315. -- rect: left=311 top=276 right=294 bottom=429
  316. -- title width / last selected line: 0
  317. -- icon id / first selected line: 0 / 0
  318. -- text alignment: 0
  319. -- font id: 3
  320. -- text size: 12
  321. -- style flags: 0
  322. -- line height: 16
  323. -- part name: Total
  324.